
project( Arduino )
cmake_minimum_required(VERSION 2.8)

set(target_name blinker)

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/../../CMakeModules" ${CMAKE_MODULE_PATH})
message( ${CMAKE_MODULE_PATH} )
#set(ARDUINO_PLATFORM uno)
#set(ARDUINO_PORT /dev/ttyACM0)

find_package(Arduino REQUIRED)

include_directories(${ARDUINO_INCLUDE_DIR})

#file(GLOB sketch src/*.ino src/*.cpp)
set(sketch src/blink.ino)
arduino_wrap_sketch( cpp_ ${sketch} )

add_executable(${target_name} ${cpp_})
target_link_libraries(${target_name}
  arduino_core
)


#generate_arduino_flash(${target_name})
arduino_generate_flash(${target_name})

